#ifndef _UTILS_LW_
#define _UTILS_LW_
#include <Windows.h>
#include <QString>
#include "CMFT.h"
#include "qtextstream.h"
// 
// extern QTextStream os;
// extern QTextStream is;

extern void SafeCloseHandle( HANDLE &hVol ) ;
extern QString wArrayToQString( WCHAR* ptr, int len );
extern QString ToString(   const SYSTEMTIME * sysTime ) ;
extern	void printMFTInfo( CMFT* mft ) ;
extern SYSTEMTIME ToSYSTEMTIME( QDateTime dt );
extern QString ToString(QDateTime dt) ;
extern QDateTime toDateTime(QString str);
#define SAFE_DELETE(p) if(p){delete(p);p=NULL;}

#define SAFE_DELETE_ARRAY(p) if(p){delete[]p;p=NULL;}
 


static inline SYSTEMTIME FileTimeToSysTime( PFILETIME fileTime )
{
	SYSTEMTIME ret;
	FILETIME local;
	FileTimeToLocalFileTime(fileTime,&local);
	FileTimeToSystemTime(&local,&ret);
	return ret;
}

#endif

